package com.new4net.exe_stream.meta;


import com.new4net.exe_stream.service.DomainModelDiagram;
import com.new4net.exe_stream.service.ExecutionInstructionService;
import com.new4net.exe_stream.service.ExecutionLogService;

import java.util.concurrent.ExecutorService;

/**
 * 执行上下文
 */
public interface ExecutionContext {

    ExecutorService getExecutor();

    ExecutionLogService getExecutionLogService();

    DomainModelDiagram getDomainModelDiagram();

    ExecutionInstructionService getExecutionInstructionService();


    <R> R getReturnVal();

    InstructionContext buildInstructionContext();


    <R> R getParam(String name);


    ExecutionContext clone();



    void addInstructionContext(InstructionContext instructionContext);

    void addParam(String name, String value);

    <R> R getParam(String name, InstructionContext instructionContext);

    interface InstructionContext {


        <R> R getReturnVal();

        <R> void addParam(String name,R value);

        <R> R getParam(String name);

        void removeParam(String name);

        void clear();


    }
}
